package com.tz.crm.dao.impl;

import com.tz.crm.dao.PropertyValueDao;
import com.tz.crm.entity.PropertyValue;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * PropertyValue Dao Impl
 */
@Repository
@Transactional
public class PropertyValueDaoImpl extends BaseDaoImpl<PropertyValue, String> implements PropertyValueDao {

    @SuppressWarnings("unchecked")
    @Override
    public List<PropertyValue> getByContractId(String id) {
        String hql = "from PropertyValue pv where pv.contract.id = :id order by pv.seq asc";
        return getSession().createQuery(hql)
                .setParameter("id", id)
                .list();
    }

}
